<div class="wrapper">
    <div class="container">
        <h3>用户登录</h3>
        <form name="loginForm" novalidate class="form">
            <input ng-model="ctrl.formModel.username" name="username" type="text" placeholder="用户名" required ng-maxlength=6>
            <input ng-model="ctrl.formModel.password" name="password" type="password" placeholder="密码" required>
          <div>
            <p ng-if="loginForm.username.$error.required" class="error">用户名不能为空</p>
            <p ng-if="loginForm.username.$error.maxlength" class="error">长度不能大于6</p>
          </div>
            <div>
              <label ng-repeat="r in ctrl.roleList" class="form-control">
                <input ng-model="ctrl.formModel.roles[$index]['checked']" type="checkbox" name="role">{{r.name}}
              </label>
            </div>
          <p ng-if="ctrl.requiredRoles" class="error">未选择角色</p>
            <button type="button" ng-click="ctrl.doLogin()">登录</button>
        </form>
    </div>
</div>